<?php
/**
 * Created by PhpStorm.
 * User: ZT
 * Date: 2020/6/30 0030
 * Time: 16:53
 **/
namespace frontend\controllers;

use frontend\component\FrontendBaseController;
use frontend\service\ArticleService;


class DefaultController extends FrontendBaseController
{
    public $layout = "/main";
    public function actionIndex(){
        $pageSize = 20;
        $result = ArticleService::getIndexData(1,$pageSize);
        return $this->render('index',[
            'data' => $result,
            'pageSize'=>$pageSize

        ]);
    }
    /*
     * 资讯详情页
     */
    public function actionDetail($aid) {
        $DetailArticle = ArticleService::getDetailArticle($aid);
        return $this->render("detail",$DetailArticle);
    }

    /****
     * 分享
     */
    public function  actionShare(){
        $result = ArticleService::getRightMessage();
        return $this->render("share",$result);
    }
}